# -*- coding:UTF-8 -*-
from enum import Enum, unique

#定义sql行为枚举值
@unique
class Action(Enum):
    select = 'SELECT * FROM'
    delete = 'DELETE FROM'

class SqlCollect:
    # 获取mem_ID
    sql_memID = 'SELECT ID,PHONE FROM tbl_member WHERE CODE = '
    # 获取档案记录ID
    sql_recordID = 'SELECT DISTINCT RECORD_ID FROM tbl_member_record WHERE IS_SELF = 1 AND MEMBER_ID = '

    # 用户相关数据
    #用户
    sqlmer01 = ' tbl_member WHERE CODE = '
    #反馈表
    sqlmer02 = ' tbl_feedback WHERE USER_CODE = '
    #推荐表
    sqlmer03 = ' tbl_recommend WHERE RECOMMEND_CODE= '
    sqlmer04 = ' tbl_recommend WHERE RECOMMENDED_CODE= '
    #图片表（member表ID）
    sqlmer05 = ' tbl_image WHERE operate_id = '

    #医生相关数据
    #医生表
    sqldoc01 = ' tbl_doctor WHERE id = '
    #医生服务
    sqldoc02 = ' tbl_doctor_servers WHERE doctor_id = '
    #医生认证表
    sqldoc03 = ' tbl_doctor_verify where doctor_id = '

    #患者数据
    #档案关系表
    sqlpat01 = ' tbl_member_record WHERE member_id = '
    #就诊人记录表
    sqlpat02 = ' tbl_member_record_apply WHERE ADD_CODE = '
    sqlpat03 = ' tbl_member_record_apply WHERE ADDED_CODE = '
    #档案表
    sqlpat04 = ' tbl_record WHERE ID = '
    #病例表  record_id
    sqlpat05 = ' tbl_case_book WHERE record_id = '
    sqlpat06 = ' tbl_case_book WHERE uploader_id = '
    sqlpat07 = ' tbl_case_book WHERE doctor_code = '
    sqlpat08 = ' tbl_case_book WHERE CONSULT_DOCTOR_CODE = '
    #诊断建议表 case_book_id
    sqlpat09 = ' tbl_medical_suggest WHERE case_book_id = '
    #关注表
    sqlpat10 = ' tbl_sns_friendship WHERE FROM_USER_CODE = '
    sqlpat11 = ' tbl_sns_friendship WHERE TO_USER_CODE = '

    #account库相关
    #以 uid 删除  获取变量值 , 获取 account_id
    sqlacc01 = ' tbl_account WHERE CODE = '
    sqlacc02 = ' tbl_bank_card WHERE account_id = '
    sqlacc03 = ' tbl_certification WHERE account_id = '
    sqlacc04 = ' tbl_payment_password WHERE account_id = '
    sqlacc05 = ' tbl_pre_deposit_change WHERE account_id = '
    sqlacc06 = ' tbl_recharge_record WHERE account_id = '
    sqlacc07 = ' tbl_wallet_payment_method WHERE account_id = '
    sqlacc08 = ' tbl_withdraw_record WHERE account_id = '
    sqlacc09 = ' tbl_idcard_image_certification WHERE account_id = '
    sqlacc10 = ' tbl_income_record WHERE ACCOUNT_ID = '
    sqlacc11 = ' tbl_reward_record WHERE ACCOUNT_ID = '

    #以 BANK_CARD 清除
    sqlban01 = ' pay_unionpay_token_open_card WHERE BANK_CARD = '

    #获取聊天室编号
    sqlroom01 = ' tbl_video_order_detail WHERE ORDER_NO ='

    #收益分配
    sqlinc01 = ' tbl_share_activity_record WHERE USER_CODE = '

    # 订单相关由家辰接口提供，暂不写入此处
    sqlord01 = ' tbl_order_partake WHERE MEM_CODE = '
    sqlord02 = ' tbl_order WHERE ORER_NO = '
    sqlord03 = ' tbl_order_attachment WHERE ORER_NO = '
    sqlord04 = ' tbl_order_log WHERE ORER_NO = '
    sqlord05 = ' tbl_order_partake WHERE ORER_NO = '
    sqlord06 = ' tbl_order_payment_detail WHERE ORER_NO = '
    sqlord07 = ' tbl_order_payment_record WHERE ORER_NO = '
    sqlord08 = ' tbl_order_refund_detail WHERE ORER_NO = '
    sqlord09 = ' tbl_order_refund_record WHERE ORER_NO = '
    sqlord10 = ' tbl_order_rejected_record WHERE ORER_NO = '
    sqlord11 = ' tbl_video_order_detail WHERE ORER_NO = '

    # 判断医院code下是否包含医生用到
    sqlhosp01 = ' tbl_doctor WHERE HOSPITAL_CODE = '
    sqlhosp02 = ' tbl_doctor_verify WHERE HOSPITAL_CODE = '
    sqlhosp03 = ' tbl_hospital WHERE CODE = '